﻿namespace OpenLS.Spreadsheet.Formats.Biff
{
    internal struct StringInfo
    {
        private readonly StringFlags _flag;

        private StringInfo(byte b)
        {
            _flag = (StringFlags)b;
        }
        private StringInfo(StringFlags b)
        {
            _flag = b;
        }
        public static explicit operator byte(StringInfo stringInfo)
        {
            return (byte)stringInfo._flag;
        }
        public static explicit operator StringInfo(byte b)
        {
            return new StringInfo(b);
        }
        public static explicit operator StringInfo(StringFlags b)
        {
            return new StringInfo(b);
        }
        public bool IsUncompressed
        {
            get { return (_flag & StringFlags.Uncompressed) != 0; }
        }

        public bool ContainsAsianPhonetics
        {
            get { return (_flag & StringFlags.ContainsAsianPhonetics) != 0; }
        }

        public bool ContainsRichText
        {
            get { return (_flag & StringFlags.ContainsRichText) != 0; }
        }
    }
}